package com.lgy.controller;

import de.felixroske.jfxsupport.FXMLController;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.image.ImageView;
import lombok.Data;

import java.net.URL;
import java.util.ResourceBundle;

@Data
@FXMLController
public class MainController extends BaseFXController implements Initializable {

    @FXML
    private Button button;

    @FXML
    private Label connectionLabel;

    @FXML
    private void click() {

    }


    @Override
    public void initialize(URL location, ResourceBundle resources) {
        ImageView connectImageView = new ImageView("static/icons/link.png");
        connectImageView.setFitHeight(40);
        connectImageView.setFitWidth(40);
        connectionLabel.setGraphic(connectImageView);
        connectionLabel.setOnMouseClicked(event -> {
            CollectionController collectionController = (CollectionController)loadFXMLPage("新建数据库连接", FXMLPage.CONNECTION, false);
            collectionController.showDialogStage();
        });
    }

}
